#include<stdio.h>

double fun(double x)
{
	if((x-0>0.0001)&&x!=2)
	{
		return (x+1)/(x-2);
	}	
	else if(x == 0||x == 2)
	{
		return 0;
	}
	else
	{
		return (x-1)/(x-2);
	}
}
int main()
{
	double input = 0;
	while(scanf("%lf",&input) != EOF)
	{
		printf("%lf",fun(input));
	}
	
	
	return 0;
}
